import React, { useEffect } from "react";
import SearchItemView from "../SearchItemView";
import { Result } from "antd-mobile";


const SearchList = ({ keyword, searchDataList }) => {

    const filterDataList = searchDataList.filter(item => {
        return item.title.includes(keyword)
    })

    return (

        <div>
            {
                filterDataList.length > 0 ? filterDataList.map((item, index) => {
                    return <SearchItemView data={item} key={index} />
                }) : <Result
                    status='info'
                    title='查询结果'
                    description='未能搜索到结果，重新试试吧~'
                />
            }
        </div>
    )
}

export default SearchList